import request from '@/router/axios';
import {baseUrl} from '@/config/env';


export const page = (tableId, data) => {
    return request({
            url: baseUrl + '/dynamicFormData/page/' + tableId,
            method: 'get',
            data: data
        }
    )
}

export const list = (tableId, data) => {
    return request({
            url: baseUrl + '/dynamicFormData/list/' + tableId,
            method: 'get',
            data: data
        }
    )
}
export const add = (tableId, data) => {
    return request({
            url: baseUrl + '/dynamicFormData/add/' + tableId,
            method: 'post',
            data: data
        }
    )
}

export const getById = (tableId, id) => {
    return request({
            url: baseUrl + '/dynamicFormData/getById/' + tableId + "/" + id,
            method: 'get',
        }
    )
}

export const updateById = (tableId, id, data) => {
    return request({
            url: baseUrl + '/dynamicFormData/updateById/' + tableId + "/" + id,
            method: 'put',
            data: data
        }
    )
}

export const deleteById = (tableId, id) => {
    return request({
            url: baseUrl + '/dynamicFormData/deleteById/' + tableId + "/" + id,
            method: 'delete',
        }
    )
}
const formDataApi={
    add,
    deleteById
}
export default formDataApi
